// customAdapter.js
const customAdapter = config => {
    return new Promise((resolve, reject) => {
        uni.request({
            url: config.url,
            method: config.method.toUpperCase(),
            data: config.data,
            header: config.headers,
            success: res => {
                const response = {
                    data: res.data,
                    status: res.statusCode,
                    statusText: res.errMsg,
                    headers: res.header,
                    config: config
                };
                resolve(response);
            },
            fail: err => {
                reject(err);
            }
        });
    });
};

export default customAdapter;